/**
 * 
 */

function getCurrentDate() {
	    var date = new Date();
	    var toDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " +  date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
	    date.setTime(date.getTime() - 30000);
	    var fromDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " +  date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
	    return fromDate + ";" + toDate;
}

function autoDefectAttack() {
	var date = getCurrentDate().split(";"); 
	$.ajax({
		type : "GET",
		url : "events/defectattack",
		data: {'fromDate': date[0], 'toDate':date[1]},
		success : function(response) {
		},
		statusCode : {
			404 : function() {
				alert("page not found");
			}
		}
	});
}
//setInterval(autoDefectAttack(),30000);

